//
//  TablesFactory.m
//  PacIsBack
//
//  Created by Simon André on 09/02/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "TablesFactory.h"
#import "ExperienceTableProtocol.h"
#import "ExperienceTableMadakia.h"
#import "ExperienceTableMonster.h"
#import "ExperienceTablePharaoh.h"
#import "StatsTableProtocol.h"
#import "StatsTableMummy.h"
#import "StatsTableMadakia.h"
#import "StatsTablePharaoh.h"
#import "SkillsGainedTableProtocol.h"
#import "SkillsGainedTableMadakia.h"
#import "SkillsGainedTableMummy.h"
#import "SkillsGainedTablePharaoh.h"

@implementation TablesFactory

+(id<ExperienceTableProtocol>) experienceTableForCharacter:(NSString*) characterType{
	id<ExperienceTableProtocol> table;
	if ([characterType compare:@"Madakia"]==NSOrderedSame) {
		table = [[ExperienceTableMadakia alloc] init];
		[table autorelease];
		return table;
	}
	else if ([characterType compare:@"Mummy"]==NSOrderedSame) {
		table = [[ExperienceTableMonster alloc] init];
		[table autorelease];
		return table;
	}
	else if ([characterType compare:@"Pharaoh"]==NSOrderedSame) {
		table = [[ExperienceTablePharaoh alloc] init];
		[table autorelease];
		return table;
	}
	return nil;
}

+(id<StatsTableProtocol>) statsTableForCharacter:(NSString*) characterType{
	id<StatsTableProtocol> table;
	if ([characterType compare:@"Madakia"]==NSOrderedSame) {
		table = [[StatsTableMadakia alloc] init];
		[table autorelease];
		return table;
	}
	else if ([characterType compare:@"Mummy"]==NSOrderedSame) {
		table = [[StatsTableMummy alloc] init];
		[table autorelease];
		return table;
	}
	else if ([characterType compare:@"Pharaoh"]==NSOrderedSame) {
		table = [[StatsTablePharaoh alloc] init];
		[table autorelease];
		return table;
	}
	return nil;
}

+(id<SkillsGainedTableProtocol>) skillsTableForCharacter:(NSString*) characterType{
	id<SkillsGainedTableProtocol> table;
	if ([characterType compare:@"Madakia"]==NSOrderedSame) {
		table = [[SkillsGainedTableMadakia alloc] init];
		[table autorelease];
		return table;
	}
	else if ([characterType compare:@"Mummy"]==NSOrderedSame) {
		table = [[SkillsGainedTableMummy alloc] init];
		[table autorelease];
		return table;
	}
	else if ([characterType compare:@"Pharaoh"]==NSOrderedSame) {
		table = [[SkillsGainedTablePharaoh alloc] init];
		[table autorelease];
		return table;
	}
	return nil;
}

@end
